package com.edais.util;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;

import org.apache.log4j.Logger;

import com.alibaba.fastjson.JSON;
import com.edais.domain.BankcardQueryBean;
import com.edais.domain.BankcardQueryRet;

public class BankCard {
	private static final Logger logger = Logger.getLogger(BankCard.class);
	
	/** 发送Http请求 */
	private String sendPostRequest(String responseUrl,String content) throws Exception {
//		URL url = new URL(responseUrl);
		URL url = new URL(null,responseUrl,new com.sun.net.ssl.internal.www.protocol.https.Handler());
		
		HttpURLConnection conn = (HttpURLConnection)url.openConnection();
        conn.setDoOutput(true);
        conn.setRequestMethod("POST");
         
        OutputStream output = conn.getOutputStream();
         
        output.write(content.getBytes());
        output.flush();
        output.close();
         
        BufferedReader reader = new BufferedReader(new InputStreamReader(conn
                .getInputStream()));
        String line;
        StringBuffer buffer = new StringBuffer("");
         
        while ((line = reader.readLine()) != null) {
            buffer.append(line);
        }
         
        String result = buffer.toString();
         
        reader.close();
        
        result = URLDecoder.decode(result, "UTF-8");
        logger.debug("银行卡bin检查中第三方返回值："+result);
        return result;
	}
	
	private boolean checkBankcard(String oldBankcode, String newBankcode){
		return oldBankcode.equals(newBankcode);
	}
	
	public static void main(String[] args){
		
	}
}
